package com.winchain.chainbill.trade.cmd;

import com.shell.bee.acct.transaction.po.AcctTxRec;
import com.shell.framework.command.CallbackContext;
import com.shell.framework.command.ICallback;
import com.winchain.chainbill.trade.service.TradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TranRollbackCmd<T> implements ICallback<T, AcctTxRec> {
	@Autowired
	private TradeService tradeService;

	public boolean callback(CallbackContext<T, AcctTxRec> context) throws Exception {
		this.tradeService.rollback((AcctTxRec) context.getTarget());
		return false;
	}
}
